home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / odosrc / diskinf.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  2.8 KB  |  100 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   1980
  5.    ClientLeft      =   1320
  6.    ClientTop       =   2265
  7.    ClientWidth     =   2775
  8.    Height          =   2385
  9.    Left            =   1260
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   1980
  13.    ScaleWidth      =   2775
  14.    Top             =   1920
  15.    Width           =   2895
  16.    Begin CommandButton Command3 
  17.       Caption         =   "Free Res"
  18.       Height          =   495
  19.       Left            =   120
  20.       TabIndex        =   6
  21.       Top             =   1320
  22.       Width           =   1095
  23.    End
  24.    Begin TextBox Text1 
  25.       Height          =   285
  26.       Left            =   2040
  27.       TabIndex        =   1
  28.       Text            =   "1"
  29.       Top             =   840
  30.       Width           =   375
  31.    End
  32.    Begin CommandButton Command2 
  33.       Caption         =   "FreeMem"
  34.       Height          =   495
  35.       Left            =   120
  36.       TabIndex        =   5
  37.       Top             =   720
  38.       Width           =   1095
  39.    End
  40.    Begin TextBox Text2 
  41.       Height          =   285
  42.       Left            =   2040
  43.       TabIndex        =   2
  44.       Text            =   "3"
  45.       Top             =   240
  46.       Width           =   375
  47.    End
  48.    Begin CommandButton Command1 
  49.       Caption         =   "DiskInfo"
  50.       Default         =   -1  'True
  51.       Height          =   495
  52.       Left            =   120
  53.       TabIndex        =   0
  54.       Top             =   120
  55.       Width           =   1095
  56.    End
  57.    Begin Label Label2 
  58.       Caption         =   "Info:"
  59.       Height          =   255
  60.       Left            =   1440
  61.       TabIndex        =   4
  62.       Top             =   840
  63.       Width           =   495
  64.    End
  65.    Begin Label Label1 
  66.       Caption         =   "Disk:"
  67.       Height          =   255
  68.       Left            =   1440
  69.       TabIndex        =   3
  70.       Top             =   240
  71.       Width           =   495
  72.    End
  73. Declare Function DiskInfo& Lib "DISKINFO.DLL" (ByVal DriveNum As Integer, ByVal InfoType As Integer)
  74. Declare Function GetFreeMem& Lib "DISKINFO.DLL" ()
  75. Declare Function GetFreeRes% Lib "DISKINFO.DLL" (ByVal InfoType As Integer)
  76. Sub Command1_Click ()
  77.     z% = Val(Text1.text)
  78.     y% = Val(text2.text)
  79.     x& = DiskInfo&(y%, z%)
  80.     MsgBox Format$(x&, "###,###,###")
  81. End Sub
  82. Sub Command2_Click ()
  83.     x& = GetFreeMem&() \ 1024
  84.     MsgBox "Free Memory = " + Format$(x&, "#,###") + "K"
  85. End Sub
  86. Sub Command3_Click ()
  87.     z% = Val(Text1.text)
  88.     x% = GetFreeRes%(z%)
  89.     res$ = ""
  90.     Select Case z%
  91.         Case 0
  92.             res$ = " [System]"
  93.         Case 1
  94.             res$ = " [GDI]"
  95.         Case 2
  96.             res$ = " [User]"
  97.     End Select
  98.     MsgBox Format$(x%, "##") + "% Free Resources" + res$
  99. End Sub
  100.